package leetcode.code1518;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public class Solution implements IDebug {

	public int numWaterBottles(int numBottles, int numExchange) {
		int ans = numBottles;
		while (numBottles >= numExchange) {
			int mod = numBottles % numExchange;
			numBottles /= numExchange;
			ans += numBottles;
			numBottles += mod;
		}
		return ans;
	}

	@Override
	public void debug1() {
		HelpDebug.compare(19, this.numWaterBottles(15, 4));

	}

	@Override
	public void debug2() {
		HelpDebug.compare(13, this.numWaterBottles(9, 3));

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug2();
		so.debug1();

	}

}
